class User < ActiveRecord::Base
  
  validates_presence_of :username, :email, :password
  validates_uniqueness_of(:email, :message => "already exists")
  validates_uniqueness_of(:username, :message => "already exists")
  
  validates_format_of :email,
                      :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i,
                      :message => 'must be a valid Mail Addy'  

  
end
